package com.example.thirdannotation.y2024.config;

import com.example.thirdannotation.y2024.bean.Person;
import com.example.thirdannotation.y2024.bean.Person2;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 * 使用 @PropertySource 将外部配置文件读取到运行的环境变量中
 */
@PropertySource(value = {"classpath:/person.properties"})
@Configuration
public class ConfigOfPropertyValues {

    @Bean
    public Person2 person2(){
        return new Person2();
    }
}
